<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="Page.Page"   %>
<%@ page import="java.util.*"%>
<%@ page import="RoverCommodity.RoverCommodity"%>
<%@ page import="RoverCommodity.RoverCommodityShow"%>
<%@ page import="Search.Search" %>
<%@ page import="java.sql.*" %>
<script language=”javascript”> 
</script>
<%
   //从数据库中去出结果集
   int currentRecord = 0;
   int DeleteID=0;
   String sql="";
   int k=0;
   int k1=0;
   String RovComID="";
   Page pager=new Page();
   //此处需要改 
   String RovID="00000001";
   String js="";
   RoverCommodityShow db =new RoverCommodityShow();
   ArrayList<RoverCommodity> result =db.RCShow(RovID);
   pager.setPageSize(10);
   pager.setTotalRecord(result.size());
   pager.setTotalPage(result.size(),pager.getPageSize());
   //计算并设置分页的参数
   if(request.getParameter("currentRecord")!=null)
   {   
       currentRecord = Integer.parseInt(request.getParameter("currentRecord"));
       pager.setCurrentRecord(currentRecord);
       pager.setCurrentPage(currentRecord,pager.getPageSize());
   }
   //从结果集中取出当前页面要显示的子集
   List<RoverCommodity>subResult = null;
   if(currentRecord == 0)
   {
       if(currentRecord+pager.getPageSize()<=result.size())
       {
            subResult = result.subList(0,pager.getPageSize());
       }
       else
       {
       	   	subResult = result.subList(0,result.size());
       }
   
   }
   else if(pager.getCurrentRecord()+pager.getPageSize()<result.size())
       subResult = result.subList(pager.getCurrentRecord(),pager.getCurrentRecord

()+pager.getPageSize());
   else
       subResult = result.subList(pager.getCurrentRecord(),result.size());
%>
<html>
  <head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>流动站商品</title>
<link href="../css/rover.css" rel="stylesheet" type="text/css" />
  </head>
  
<body>
<div class="wrapper_first">
  <p class="title_first">当前位置 ： 东师格子铺 ----->流动站 </p>
</div>
<form name="From1" method="POST" action="../Search/SearchGC.jsp"
		onsubmit="javaScript: return validate();">
<div class="title"><img src="../images/hover_02_01_03.png" />
    <div class="title_2"><select name="SearchWay" class="xuanze_css"><option value="All">全部信息</option></select><input name="sousuo" type="text" class="sousuo" /></div>
    <div class="sousuoDiv"><input name="submit" type="submit" class="souduoqueren" value=""/></div>
</div>
</form>
<div class="blockUnderNav"></div>
<div class="wrapper_left_prod">

	<ul class="ul_prod">
		  	<%
   			 if(subResult.isEmpty()==false)
		       {
		             for(int i=0;i<subResult.size();i++)
		             {
		            	 RoverCommodity RoverCommodity = subResult.get(i);
		            	 String saveurl=request.getRealPath("/")+RoverCommodity.getComImage();
		            	 %>
    	<li>
        	<a href='RoverCommodityDetailed.jsp?RovComID=<%=RoverCommodity.getComID()%>'><img src='../<%=RoverCommodity.getComImage()%>'></a>
            <div class="pro_info"><%=RoverCommodity.getRecency()%>新<span class="price">￥+<%=RoverCommodity.getComPrice()%></span></div>
            <div class="phont_pro">电话：<%=RoverCommodity.getSellerPh()%></div>
        </li>
                   <%} %>
           <%} %>
    </ul>
</div>
<div class="wrapper_right_prod">
	<div class="wrapper_oneKeySold">
    	<a href="" class="link_oneKey"></a>
        <ul class="ul_oneKey">
        	<li><a href="">运动休闲</a></li>
            <li><a href="">礼品服饰</a></li>
            <li><a href="">个人闲置</a></li>
            <li><a href="">图书类</a></li>
            <li><a href="">数码产品</a></li>
            <li><a href="">电脑周边</a></li>
        </ul>
    </div>
    
   <div class="hotPro">
   		<h3 class="title_hotPro">热门商品</h3>
   		<ul class="ul_hotPro">
        	<li>
            	<a href=""><img src="../images/index_3_09.jpg" /></a>
                <div class="info_hotPro">
                	<span>【九成新以上】</span><br />
                    <span>LED台灯当减肥肯定加防空洞</span><br />
                    <span class="price_hotPro">10.0元</span><br />
                    <span>电话：13578980987</span>
                </div>
            </li>
            <li>
            	<a href=""><img src="../images/index_3_09.jpg" /></a>
                <div class="info_hotPro">
                	<span>【九成新以上】</span><br />
                    <span>LED台灯当减肥肯定加防空洞</span><br />
                    <span class="price_hotPro">10.0元</span><br />
                    <span>电话：13578980987</span>
                </div>
            </li>
            <li>
            	<a href=""><img src="../images/index_3_09.jpg" /></a>
                <div class="info_hotPro">
                	<span>【九成新以上】</span><br />
                    <span>LED台灯当减肥肯定加防空洞</span><br />
                    <span class="price_hotPro">10.0元</span><br />
                    <span>电话：13578980987</span>
                </div>
            </li>

                   </ul>
        <br clear="all" />
   </div>
</div>
<div class="page">
 <font size="3">总<%=pager.getTotalRecord()%>条记录|总<%=pager.getTotalPage()%>页|当

		前<%=pager.getCurrentPage()+1%>页|每页<%=pager.getPageSize()%>条|
		<% 
		    //如果已经到了首页就去掉前一页的链接
		    if(pager.getCurrentRecord()-pager.getPageSize()<0)
		        out.println("首页|");
		    else
		    //上一页就是把当前记录位置减去一页显示记录的条数
		        out.print("<a href='RoverCommodityShow.jsp?currentRecord="+(pager.getCurrentRecord()-
		
		pager.getPageSize())+"&pageSize="+pager.getPageSize()+"'>上一页</a>|");
		    //如果到了尾页就去掉下一页的链接
		    if(pager.getCurrentRecord()+pager.getPageSize()>=pager.getTotalRecord())
		        out.println("尾页");
		    else
		    //下一页就是把当前记录位置加上一页显示记录的条数
		        out.print("<a href='RoverCommodityShow.jsp?currentRecord="+(pager.getCurrentRecord
		
		()+pager.getPageSize())+"&pageSize="+pager.getPageSize()+"'>下一页</a>|"); 
		%>
	</font></span></div>
</body>
</html>
